The self-moving robot has been widely used for its convenient operation and freedom of movement, and has a variety of applications including window wiping, floor sweeping, air purification and so on. The self-moving robot sometimes runs into obstacle during its operation and can accurately and effectively avoid the obstacle during the self-moving walking process, hereby greatly improving the working efficiency. As an example of the glass-wiping robot, the prior art CN02137830.4 provides a method for identifying cleanable area and obstacle area for an automatic dust collector. FIG. 1 is a schematic diagram of the obstacle avoidance walking of the existing self-moving robot. Referring to FIG. 1, if the movements of the self-moving robot are classified into movements in the horizontal direction (X axis) and in the vertical direction (Y axis), FIG. 1 is a schematic diagram of the traversing in the X-axis direction and obstacle avoidance walking in the Y-axis direction of the self-moving robot. As shown in FIG. 1, the self-moving robot walks along the respective reciprocating paths of Y1, Y2 and Y3. When the self-moving robot runs into the obstacle A4, it bypasses the obstacle and walks in a reciprocating manner in the vertical direction, wherein the bypassing action is performed every time the self-moving robot runs into the obstacle A4 in the vertical direction. As a result of the walking mode of the existing self-moving robot, the walking on the path at the right side of the obstacle A4 is repeated for many times, which greatly prolongs the walking time and seriously impairs the working efficiency of the robot.